from .celery import app

@app.task
def log_new():
    fname = 'F:\lufei\luffyapi\logs\luffy.log'
    with open(fname, 'r', encoding='utf-8') as f,\
        open('log_new.log','a',encoding='utf-8') as f2:# 打开文件
        lines = f.readlines()  # 读取所有行
        last_line = lines[-1]  # 取最后一行
        f2.write(last_line)
